<%@ page contentType="text/html;charset=UTF-8"%><meta http-equiv="Content-Type"
	content="text/html;charset=utf-8" pageEncoding="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8,IE=9,IE=10" />
<meta http-equiv="Expires" content="0">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Cache-Control" content="no-store">

<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<link href="${ctxStatic}/new/css/bootstrap.css?223" type="text/css" rel="stylesheet" />


<script type="text/javascript" src="${ctxStatic}/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="${ctxStatic}/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="${ctxStatic}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript" src="${ctxStatic}/jquery-ztree/3.5.12/js/jquery.ztree.all-3.5.min.js"></script>
<link href="${ctxStatic}/jquery-select2/3.4/select2.min.css" rel="stylesheet" />
<script src="${ctxStatic}/jquery-select2/3.4/select2.min.js" type="text/javascript"></script>
<link href="${ctxStatic}/jquery-validation/1.11.0/jquery.validate.min.css" type="text/css" rel="stylesheet" />
<script src="${ctxStatic}/jquery-validation/1.11.0/jquery.validate.js" type="text/javascript"></script>
<link href="${ctxStatic}/jquery-jbox/2.3/Skins/Bootstrap/jbox.min.css" rel="stylesheet" />
<script src="${ctxStatic}/jquery-jbox/2.3/jquery.jBox-2.3.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/common/andyou.js" type="text/javascript"></script>

<!--  add for lgx 20161022  -->
<script src="${ctxStatic}/common/json2.js" type="text/javascript"></script>
<!--  add for lgx 20161022  -->
<script src="${ctxStatic}/common/jqueryUtil.js" type="text/javascript"></script>


<link rel="stylesheet" type="text/css" href="${ctxStatic}/new/plugins/layui/css/layui.css">
<link rel="stylesheet" href="${ctxStatic}/new/css/common.css">
<script type="text/javascript" src="${ctxStatic}/new/plugins/layui/layui.js"></script>

<!-- icheck-bootstrap 单选/复选框美化  -->
<link rel="stylesheet" href="${ctxStatic}/icheck-bootstrap/css/icheck-bootstrap.css?v=1224434341">


<script type="text/javascript">

layui.use(['layer'], function () {
	parent.layer.closeAll('loading');
});

    //关闭加载中。。。
    closeTip();
 
	$(function(){
		
		//查询提交时，重新赋值  查询一页的数据个数
		$("#searchForm").submit(function() {
			var pagesize = $('select[name=pagesize]').val();
			$('#pageSize').val(pagesize);
		});

		//初始化时   分页显示pagesize页面  绑定当前数据
		var pagesize = $('select[name=pagesize]').attr("data-pagesize");
		$('select[name=pagesize]').val(pagesize);
		$("select[name=pagesize]").find("option[value='" + pagesize + "']")
				.attr("selected", true);
		$(".pagination").find(".select2-chosen").text(pagesize);
		
		$('select[name=pagesize]').bind("change",function(){
			$("#searchForm").submit();
		});
		
		//列表为空时，表头跟表体一样的长度
		var width=$(".boxthead").find("table").width();
		$(".boxbody").find(".undata>td").css("width",width-17);
		
		
		//添加键盘监听事件
		$(document).keydown(function(event){ 
			//alert(event.keyCode);
			if(event.keyCode == 13){//回传事件 
		      $("#btn_search").click();
		     }else if(event.keyCode == 27){//esc 事件
		    	
		    	 //会把所有的隐藏值都清空，导致弹出框用不了
		    	/**$("#searchForm input").each(function(){  
		    		     $(this).val('');  
		    	});  
		        $("#searchForm select").each(function(){  
		    		  $(this).val('');  
		         });  */ 
		       document.getElementById("searchForm").reset();
		       $("#btn_search").click();
			}
			
		});
		
	});
	
	function formReset()  {  
	     document.getElementById("inputForm").reset()  
	}  
	
	function formResetBySearch(){
	       document.getElementById("searchForm").reset();
	       $("#btn_search").click();
	}
	
	//页面调整
	function gotoView(url){
		loading("正在加载中...");
		window.location.href = url;
	}
	
	$.fn.serializeObject = function() {
		var o = {};
		var a = this.serializeArray();
		$.each(a, function() {
			if (o[this.name]) {
				if (!o[this.name].push) {
					o[this.name] = [ o[this.name] ];
				}
				o[this.name].push(this.value || '');
			} else {
				o[this.name] = this.value || '';
			}
		});
		return o;
	};

</script>





